<?
$db_introduce = new db_query('SELECT * FROM user_introduce WHERE ui_active = 1 AND lang_id = ' . $lang_id . ' ORDER BY ui_order ASC');
// Hiển thị ngẫu nhiên
if ($con_introduce_type == 0) 
{ 
    $row = mysql_fetch_array($db_introduce->result);
    if (getExtension($row['ui_picture']) == 'swf')
    {
        $ui_format = 'flash';
    }
    else
    {
        $ui_format = 'image';
    }
    ?>
    <div class="introduce">
        <div class="content">
        <?
        if (getExtension($row['ui_picture']) == 'swf')
        {
        ?>
        <script type="text/javascript">
        AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0',
                        'width','<?=$row['ui_width'];?>',
                        'height','<?=$row['ui_height'];?>',
                        'title','<?=$row['ui_name'];?>',
                        'src','/user_introduce/<?=substr($row['ui_picture'],0,strrpos($row['ui_picture'],'.'));?>',
                        'quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','wmode','transparent' );
        </script>
        <?
        }
        else if ($ui_format == 'image')
        {
        ?>
        <a title="<?=$row['ui_name'];?>" href="<?=$row['ui_link'];?>" target="<?=$row['ui_target'];?>"><img src="/user_introduce/<?=$row['ui_picture'];?>"></a>
        <?
        }
        ?>
        </div>
    </div>
<?} 
elseif ($con_introduce_type == 1) 
{ 
    // Hiển thị kèm hiệu ứng
?>
<script language="javascript">
var imageArray= Array();
var linkArray= Array();
var titleArray= Array();
var targetArray= Array();
var title_link= Array();
<?
$i = 0;
while ($row = mysql_fetch_array($db_introduce->result))
{
	if (getExtension($row['ui_picture']) == 'swf')
	{
		$ui_format = 'flash';
	}
	else
	{
		$ui_format = 'image';
	}
	if ($ui_format == 'image')
	{
?>
imageArray[<?=$i;?>]= ["/user_introduce/<?=$row['ui_picture'];?>"];
linkArray[<?=$i;?>]= ["<?=$row['ui_link'];?>"];
titleArray[<?=$i;?>]= ["<?=$row['ui_name'];?>"];
targetArray[<?=$i;?>]= ["<?=$row['ui_target'];?>"];
title_link[<?=$i;?>]= ["<a class=\"introduce_name\" href=\"<?=$row['ui_link'];?>\" target=\"<?=$row['ui_target'];?>\"><?=$row['ui_name'];?></a>"];
<?
	}
	++$i;
}
?>
</script>
<div class="introduce_top"><div class="fl"></div><div class="fr"></div></div>
<div class="introduce">
	<div class="content">
    	<a id="imageLink" href="#"><img id="imagePhoto" src="<?=$theme_imagepath?>introduce.gif" style="filter:progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=0.3,wipestyle=1,motion=reverse,duration=3)" /></a>
    </div>
</div>
<div class="introduce_bottom"><div class="fl"></div><div class="fr"></div></div>
<script type="text/javascript" src="<?=$theme_jspath?>doTrans.js"></script>
<script type="text/javascript">setInterval("doTrans()", <?=$con_intro_time?>);</script>
<? } elseif ($con_introduce_type == 2) { // Hiển thị theo thứ tự?>
<?
$row = mysql_fetch_array($db_introduce->result);
if (getExtension($row['ui_picture']) == 'swf')
{
	$ui_format = 'flash';
}
else
{
	$ui_format = 'image';
}
?>
<div class="introduce">
	<div class="content">
        <?
		if (getExtension($row['ui_picture']) == 'swf')
		{
		?>
		<script type="text/javascript">
		AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0',
				'width','<?=$row['ui_width'];?>',
				'height','<?=$row['ui_height'];?>',
				'title','<?=$row['ui_name'];?>',
				'src','/user_introduce/<?=substr($row['ui_picture'],0,strrpos($row['ui_picture'],'.'));?>',
				'quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','wmode','transparent' );
		</script>
		<?
		}
		else if ($ui_format == 'image')
		{
		?>
			<a title="<?=$row['ui_name'];?>" href="<?=$row['ui_link'];?>" target="<?=$row['ui_target'];?>"><img src="/user_introduce/<?=$row['ui_picture'];?>"></a>
		<?
		}
		?>
    </div>
</div>
<? } elseif ($con_introduce_type == 3) { // Hiển thị theo gallery (kích thước 610 x 300)?>
<link rel="stylesheet" type="text/css" href="js/jslider/layer.css" />
<link rel="stylesheet" type="text/css" href="js/jslider/style.css" />
<script language="javascript" type="text/javascript" src="js/jslider/jquery.easing.js"></script>
<script language="javascript" type="text/javascript" src="js/jslider/script.js"></script>
<script type="text/javascript">
    $(document).ready( function(){
        var buttons = { previous:$('#lofslidecontent45 .lof-previous') ,
			next:$('#lofslidecontent45 .lof-next') };
	$obj = $('#lofslidecontent45').lofJSidernews( {
            interval    : 5000,
            direction	: 'opacitys',
            easing	: 'easeInOutQuad',
            duration	: 1200,
            auto	: true,
            maxItemDisplay  : 6,
            navPosition     : 'horizontal', // horizontal
            navigatorHeight : 32,
            navigatorWidth  : 80,
            mainWidth   :598,
            buttons	: buttons
        });
    });
</script>
    <div id="container">
        <!------------------------------------- THE CONTENT ------------------------------------------------->
        <div id="lofslidecontent45" class="lof-slidecontent" style="width:598px; height:273px;">
            <div class="preload"><div></div></div>
            <!-- MAIN CONTENT -->
            <div class="lof-main-outer" style="width:598px; height:225px;">
                <ul class="lof-main-wapper">
                <?
                $No = 0;
                $listAll = array();
                while ($row = mysql_fetch_array($db_introduce->result))
                {
                    if (getExtension($row['ui_picture']) != 'swf')
                    {
                        $listAll[$No] = $row;
                        ++$No;
                        ?>
                        <li>
                            <img alt=""  src="/user_introduce/<?=$row['ui_picture']?>" title="<?=$row['ui_name']?>" style="width: 598px;height: 225px;" />
                            <div class="lof-main-item-desc">
                                <h3><a target="<?=$row['ui_target']?>" title="<?=$row['ui_name']?>" href="<?=$row['ui_link']?>"><?=$row['ui_name']?></a></h3>
                                <p>The one thing about a Web site, it always changes! Joomla! makes it easy to add Articles, content,...</p>
                            </div>
                        </li>      
                        <?
                    }
                }
                ?>    
                </ul>
            </div>
            <!-- END MAIN CONTENT -->
            <!-- NAVIGATOR -->
            <div class="lof-navigator-wapper">
                <div onclick="return false" href="" class="lof-next"></div>
                <div class="lof-navigator-outer">
                    <ul class="lof-navigator">
                    <?
                    for ($i=0;$i<$No;$i++)
                    {
                        ?>
                        <li><img src="/user_introduce/small_<?=$listAll[$i]['ui_picture']?>" alt="<?=$listAll[$i]['ui_name']?>" title="<?=$listAll[$i]['ui_name']?>" style="width: 70px;height: 25px;" /></li>
                        <?
                    }
                    ?>                   
                    </ul>
                </div>
                <div onclick="return false" href="" class="lof-previous"></div>
            </div>
            <!----------------- --------------------->
        </div>
    </div>
<? } elseif ($con_introduce_type == 4) { // Hiển thị theo link Youtube?>
<div class="introduce"><div class="content">
<?
$row = mysql_fetch_array($db_introduce->result);
echo $row['ui_link'];
?>
</div></div>
<? }?>
<?
unset($db_introduce);
?>